<template>
  <view class="container">
    <view v-if="sts == 0">
      <view class="pay-sts fail">支付失败</view>
      <view class="tips">请在 <text class="warn">30分钟</text>内完成付款</view>
      <view class="tips">否则订单会被系统取消</view>
      <view class="btns">
        <text class="button checkorder" @click="toOrderList">查看订单</text>
        <text class="button payagain" @click="payAgain">重新支付</text>
      </view>
    </view>
    <view v-if="sts == 1">
      <view class="pay-sts succ">支付成功</view>
      <view class="tips">感谢您的购买</view>
      <view class="btns">
        <text class="button checkorder" @click="toOrderList">查看订单</text>
        <text class="button shopcontinue" @click="toIndex">继续购物</text>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      sts: 0,
    };
  },
  onLoad: function () {
    //获取路由参数
    this.sts = this.$mp.query.sts;
    console.log(this.sts);
  },

  methods: {
    //查看订单
    toOrderList() {
      wx.navigateTo({
        url: "/pages/user/orderList/index?sts=" + this.sts,
      });
    },

    //重新支付
    payAgain() {
      wx.showLoading({
        mask: true,
      });
      console.log("重新支付");
    },
  },
};
</script>

<style src="./index.css" scoped></style>
